import { BTNode } from "../BTNode";
import { BehaviorTree } from "../BehaviorTree";

/**
 * [行为树]修饰节点
 */
export abstract class BTDecorator<T = any> extends BTNode<T> {

    constructor(
        /** 子节点 */
        public child: BTNode<T>
    ) {
        super();
    }

    setTree(tree: BehaviorTree<T>): void {
        super.setTree(tree);
        this.child.setTree(tree);
    }

    done(): void {
        super.done();
        this.child.done();
    }

}